import request from '@/utils/request'

// 查询人才股票列表
export function listStock(query) {
  return request({
    url: '/operate/stock/list',
    method: 'get',
    params: query
  })
}

// 查询正在发行人才股票列表
export function listOngoStock(query) {
  return request({
    url: '/operate/stock/listOngoStock',
    method: 'get',
    params: query
  })
}

// 查询完成发行人才股票列表
export function listFinishStock(query) {
  return request({
    url: '/operate/stock/listFinishStock',
    method: 'get',
    params: query
  })
}

// 根据发行人id查股票信息
export function selectUpdateStockList(query) {
  return request({
    url: '/operate/stock/selectUpdateStockList',
    method: 'get',
    params: query
  })
}

// 根据购买人ID查询持有人的对应股票
export function selectHoldStockList(query) {
  return request({
    url: '/operate/stock/selectHoldStockList',
    method: 'get',
    params: query
  })
}
// 查询人才股票详细
export function getStock(id) {
  return request({
    url: '/operate/stock/' + id,
    method: 'get'
  })
}

// 查询拥有人的人才股票详细
export function getStockByOwner(id) {
  return request({
    url: '/operate/stock/getStockByOwner/' + id,
    method: 'get'
  })
}

// 新增人才股票
export function addStock(data) {
  return request({
    url: '/operate/stock',
    method: 'post',
    data: data
  })
}

// 修改人才股票
export function updateStock(data) {
  return request({
    url: '/operate/stock',
    method: 'put',
    data: data
  })
}

// 删除人才股票
export function delStock(id) {
  return request({
    url: '/operate/stock/' + id,
    method: 'delete'
  })
}

// 导出人才股票
export function exportStock(query) {
  return request({
    url: '/operate/stock/export',
    method: 'get',
    params: query
  })
}
